library(devtools)
## Loading required package: usethis
install_github("Shijia1997/ADMerge",upgrade = "never")
## Skipping install of 'ADMerge' from a github remote, the SHA1 (a920aec8) has not changed since last install.
##   Use `force = TRUE` to force installation
library(ADMerge)
library(tidyr)

ADNI date

data_path = "ADNI date"

scr_table = get_src_table(path = data_path, ID_pattern = "ID", DATE_pattern = "VIS|DATE", ID_usr_list = c("RID"), DATE_usr_list = c("VISDATE","EXAMDATE"))

Each file identified as longitudinal will be join with the their “ID_for_merge” as y-axis and “DATE_for_merge” as x-axis for visualization. The DATE_for_merge from different files are integrated to the same timeline

By pass the source table into the “plot.files” function, we are able to visualize the distribution.

The user are able to hang over their mouses to points in the plot to highlight the all the scatter belongs to that group (file) while the users can also use the dropdown bar to visualize each file indivudally

plot_files(path = data_path, dict_src = scr_table, study_type = "ADNI",date_type = "Date")
data_path = "ADNI visnumbr"

scr_table = get_src_table(path = data_path, ID_pattern = "ID", DATE_pattern = "VIS|DATE", ID_usr_list = c("RID"), DATE_usr_list = c("VISCODE"),non_longitudinal_list = c("DESIKANLAB_14Apr2024"))

plot_files(path = data_path, dict_src = scr_table, study_type = "ADNI",date_type = "Number")

Biocard Date

data_path = "BIOCARD August 2021 internal"

scr_table = get_src_table(path = data_path, ID_pattern = "ID", DATE_pattern = "VIS|DATE", ID_usr_list = c("SUBJECT_ID"), DATE_usr_list = c("date","VISITDATE","MRIDATE"))


plot_files(path = data_path, dict_src = scr_table, study_type = "BIOCARD",date_type = "Date")
## Warning in RColorBrewer::brewer.pal(length(unique(combined_data$color)), : minimal value for n is 3, returning requested palette with 3 different levels
data_path = "BIOCARD August 2021 internal"

scr_table = get_src_table(path = data_path, ID_pattern = "ID", DATE_pattern = "VIS|DATE", ID_usr_list = c("SUBJECT_ID"), DATE_usr_list = c("VISITNO"))

scr_table
## # A tibble: 2 × 9
##   file          VARS_in_file ID_in_file DATE_in_file ID_for_merge DATE_for_merge
##   <chr>         <chr>        <chr>      <chr>        <chr>        <chr>         
## 1 BIOCARD_Cogn… JHUANONID; … JHUANONID… VISITNO; VI… SUBJECT_ID   VISITNO       
## 2 BIOCARD_MRI_… JHUANONID; … JHUANONID… VISITNO; MR… SUBJECT_ID   VISITNO       
## # ℹ 3 more variables: longitudinal <lgl>, IS_overlap <lgl>, WINDOW <dbl>
plot_files(path = data_path, dict_src = scr_table, study_type = "BIOCARD",date_type = "Number")
## Warning in RColorBrewer::brewer.pal(length(unique(combined_data$color)), : minimal value for n is 3, returning requested palette with 3 different levels